﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ApiDemo.Domain;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace ApiDemo.Controllers
{
    [Route("cms/page")]
    [ApiController]
    public class CmsController : ControllerBase
    {
        /// <summary>
        /// test 接口
        /// </summary>
        /// <param name="page">頁碼</param>
        /// <param name="size">行數</param>
        /// <param name="queryRequest">要傳值,無值則傳:{}</param>
        /// <returns></returns>
        [HttpGet]
        [Route("list/{page}/{size}")]
        public async Task<QueryRequestModel> GetById(int page, int size, QueryRequestModel queryRequest)
        {
            queryRequest = new QueryRequestModel()
            {
                content = "xxxx"
            };
            return queryRequest;

            //if (queryRequest == null)
            //{
            //    return Ok(new { seq = 1, id = id, name = name });
            //}
            //else
            //{
            //    return Ok(new { seq = 2, id = id, name = name, queryRequest = queryRequest.content });
            //}
        }


    }
}